},
_doRemoveWindow(metaWin) {
- // find the position of the window in our list
- let index = this._lookupIndex (metaWin);
-
- if (index == -1)
- return;
-
- let clone = this._windows[index];
- this._windows.splice(index, 1);
-
- clone.destroy();
+ let clone = this._removeWindowClone(metaWin);
+ if (clone)
+ clone.destroy();
},
_doAddWindow(metaWin) {
clone.connect('drag-end', () => {
Main.overview.endWindowDrag(clone.metaWindow);
});
+ clone.actor.connect('destroy', () => {
+ this._removeWindowClone(clone.metaWindow);
+ });
this._contents.add_actor(clone.actor);
if (this._windows.length == 0)
return clone;
},
+ _removeWindowClone(metaWin) {
+ // find the position of the window in our list
+ let index = this._lookupIndex (metaWin);
+
+ if (index == -1)
+ return null;
+
+ return this._windows.splice(index, 1).pop();
+ },
+
activate(time) {
if (this.state > ThumbnailState.NORMAL)
return;